package com.ldwu.home.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import com.ldwu.home.dao.base.UserDaoMapper;

@Controller
@RequestMapping("/")
public class Test_GetUserController {
    @Autowired
    private UserDaoMapper userDaoMapper;

    @RequestMapping("/username")
    public ModelAndView userName(){
        ModelAndView mv = new ModelAndView("template/username");

//        List result = new ArrayList();
//        result.add("hh");
//        result.add("oo");

        List<String> list = userDaoMapper.listAllNames();
        mv.addObject("title","Hello World");
        mv.addObject("content","This is text page.You name is " + list);

        return mv;
    }
}
